package com.studentSystem.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.studentSystem.anno.Gender;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.groups.Default;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

@Data
public class Student {
    @NotNull(groups = Student.Update.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    @NotNull
    private String name;
    private int age;
    @Gender
    private String gender;

    @NotEmpty
    private String content;

    @NotEmpty
    @URL
    private String coverImg;

    private String address;
    @Pattern(regexp = "^1[3-9]\\d{9}$")
    private String phoneNumber;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long classId;

    public interface Add extends Default {

    }

    public interface Update extends Default {

    }
}
